/**
 * --------------------------------------------------------------------------
 * Hi.js (v1.0.0): Form.js
 * require jquery
 * --------------------------------------------------------------------------
 */
;(function($, window, document, undefined) {
    "use strict";

	//定义Element的构造函数
    var Form = function(option) {};
    
    Form.VERSION = '1.0.0';

    //定义Form的方法
    Form.prototype = {
        init: function() {
            this.render();
            this.bind();
            // 选择框样式重置
            $('.select-box>.form-select').trigger('change');
        },
        render: function() {
        },
        bind: function() {
            // 选择框选中
            $(document).on('change', '.select-box>.form-select', $.proxy(this['_selectHandler'], this));
        },
        _selectHandler: function(e) {
            $(e.target).prev().html($(e.target).find('option[value="' + $(e.target).val() + '"]').html() || $(e.target).find('option[value=""]').html()).attr('data-value', $(e.target).val());
        }
    }
    new Form().init();
})(jQuery, window, document);